﻿using System;
using System.Collections.Generic;

using System.Windows;
using System.Windows.Threading;

namespace EagleJournal.Components
{
    public static class EagleMessageBox
    {
        private static CharmMessageBox messagebox;

        public static void Atttach(CharmMessageBox mbox)
        {
            messagebox = mbox;
        }
        public static void Remove()
        {
            messagebox = null;
        }

        public static void ShowMessageBox(string title, string message, MessageBoxImage image, MessageBoxButton buttons)
        {
            if (messagebox != null)
                messagebox.Dispatcher.Invoke(new Action(() =>
                    {
                        messagebox.ShowMessage(title, message, image, buttons);

                    }), DispatcherPriority.Normal, null);
        }
    }
}
